import random
import time

correctCount = 0
count = 0
NUMBR_OF_QUESTIONS = 5

startTime = time.time()

while count < NUMBR_OF_QUESTIONS:
    number1 = random.randint(1,16)
    number2 = random.randint(1,16)

    if number1 < number2:
        number1,number2 = number2,number1

    answer = eval(input(str(number1)+"-"+str(number2)+"="))

    if number1 - number2 == answer:
        print("回答正确")
        correctCount += 1
    else:
        print("回答错误\n",number1,"-",number2,"=",number1-number2)
    count += 1


endTime = time.time()

testTime = int(endTime-startTime)
print("测试结果：",correctCount,"/",NUMBR_OF_QUESTIONS,"\n测试花费：",testTime,"秒")